<template>
	<view class="my">
		<view class="content">
			<view class="user">

				<!--  <button v-if="canIUseGetUserProfile" @click="getUserProfile"> 登陆 </button> -->
				<!--   <button  v-if="!hasUserInfo" @click="login"> 登陆 </button> -->
				<!-- <button  v-else> {{userInfo.name}} </button> -->
				<view class="userimg">
					<text class="user_name">微信用户</text>
					<img src="../../static/mrtx.png" />

				</view>


			</view>

		</view>
		<view class="list">
			<view class="list-item" v-if="isShowTop==0" @click="tg">
				<img src="../../static/lxwm.png" alt="" />
				<span>联系我（小程序开发）</span>
			</view>
		</view>
		<view class="lxw" v-if="isShow">
			<view class="lxw_content">
				<img src="https://www.leedong.top/img/erweima.png" alt="" />
				<p>小程序专业开发（商家/门店推广、公司官网）</p>
			</view>
		</view>

	</view>
</template>
<script>
	export default {
		data() {
			return {
				userInfo: {},
				name: "",

				avatarUrl: "",
				isShowTop: 0,
				hasUserInfo: false,
				canIUseGetUserProfile: false,
				isShow: false
			}
		},
		onShareAppMessage(res) {
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
			return {
				title: "一起学诗词吧",
				imageUrl: "https://www.leedong.top/img/11556.png"
			}
		
		},
		//2.分享到朋友圈
		onShareTimeline() {
		
			return {
				title: '一起学诗词吧',
				imageUrl: "https://www.leedong.top/img/11556.png",
		
		
			}
		},
		onShow() {

			let userInfo = uni.getStorageSync('user')

			if (userInfo != "" && userInfo) {
				this.userInfo = userInfo
				console.log(this.userInfo)
				this.hasUserInfo = true
			} else {
				this.hasUserInfo = false
			}

		},
		onLoad() {
			this.geuTuiguang()
		},
		methods: {
			tg() {
				this.isShow = !this.isShow;
			},
			geuTuiguang() {
				this.$api.tuiguang().then((res) => {
					console.log(res)
					this.isShowTop = res.rows[0].name;
				})
			},

			login() {
				uni.navigateTo({
					url: '/pages/login/login'
				})
			},
			userInfos() {
				uni.navigateTo({
					url: "/pages/login/login"
				})
			},
			nickname(v) {
				console.log(v)
				console.log(this.name)
			},
			// onChooseAvatar(e) {
			//  console.log(e)
			//    const { avatarUrl } = e.detail;
			//    this.avatarUrl=avatarUrl
			//    uni.setStorageSync('user_img',avatarUrl)
			//  },

			// getUserInfo(e) {
			//    console.log(e,"0000")
			//  this.userInfo=e.detail.userInfo;
			//  this.hasUserInfo=true
			//   // 不推荐使用getUserInfo获取用户信息，预计自2021年4月13日起，getUserInfo将不再弹出弹窗，并直接返回匿名的用户个人信息

			// },
		}
	}
</script>
<style lang="scss">
	.my {
		.list {
			width: 100%;
			box-shadow: rgba(0, 0, 0, 0.1) 4px 2px 11px;
			margin-top: 100px;
			height: 40px;
			padding: 20px;
			line-height: 40px;

			.list-item {
				width: 80%;
				display: flex;
				align-items: center;

			}

			span {

				color: #000;
				padding-left: 20rpx;
			}

			img {
				width: 30px;
				height: 30px;
				display: inline-block;
			}
		}

		.lxw {
			width: 100%;
			display: flex;
			justify-content: center;
			margin-top: 30px;

			.lxw_content {

				margin-left: 20px;

				img {
					width: 80%;
					margin-left: 45rpx;
				}

				p {
					font-size: 28rpx;
				}
			}
		}

		.content {
			width: 100%;

			height: 100px;
			position: relative;
			border-radius: 0 0 120px 120px;
			background-color: #7d8468;

			.user {
				width: 80px;
				border-radius: 50%;
				background-color: #fff;
				position: absolute;
				left: 50%;
				text-align: center;
				line-height: 80px;
				bottom: -40px;
				transform: translateX(-50%);
				height: 80px;

				.userimg {
					width: 80px;
					height: 150px;

					img {
						width: 80px;
						height: 80px;
						border-radius: 50%;
					}

					.user_name {
						position: absolute;
						left: 50%;
						width: 100px;
						bottom: -70px;
						transform: translateX(-50%);
					}
				}

				span {}

				button {
					border: 0;
					line-height: 80px;
					outline: 0;
					background: transparent;
				}

				button::after {
					border: 0;
					outline: 0;
				}
			}

		}
	}
</style>